gtkfilesystem: protect against null filesystem type
authorCarlos Soriano <csoriano@gnome.org>
Wed, 7 Oct 2015 23:19:19 +0000 (01:19 +0200)
committerCarlos Soriano <csoriano@gnome.org>
Wed, 7 Oct 2015 23:21:28 +0000 (01:21 +0200)
The filesystem:type attribute could be NULL, then g_strv_contains
will crash if that happens.
Just don't call it if the attribute is not set.

gtk/gtkfilesystem.c

index 09601bd261788e3ea9693a31ea3fee6caa0c5f05..a26619443b1b3aa8027e14052030ff857ea48ad9 100644 (file)
@@ -947,7 +947,10 @@ _gtk_file_consider_as_remote (GFile *file)
       const gchar *type;
 
       type = g_file_info_get_attribute_string (info, "filesystem::type");
-      is_remote = g_strv_contains (remote_types, type);
+      if (type != NULL)
+        is_remote = g_strv_contains (remote_types, type);
+      else
+        is_remote = FALSE;
 
       g_object_unref (info);
     }